package com.ruoyi.controller;

import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.engine.domain.BpmProcessDefinition;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/t")
public class aaController {
    @GetMapping("/list")
    public String list(BpmProcessDefinition bpmProcessDefinition)
    {

        List<SysRole> roleList = SecurityUtils.getLoginUser().getUser().getRoles();
        Collection<String> roles = roleList.stream().map(SysRole::getRoleKey).collect(Collectors.toSet());

        System.out.println(SecurityUtils.getLoginUser().getUser().getScore());

        return roles.toString();
    }
}
